package com.neu.service;

import com.neu.mapper.UserMapper;
import com.neu.pojo.Fund;
import com.neu.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper mapper;
    @Override
    public User getUserById(String openid) {
        return mapper.getUserById(openid);
    }

    @Override
    public List<User> getAllUsers() {
        return mapper.getAllUsers();
    }

    @Override
    public int deleteUserById(String openid) {
        return mapper.deleteUserById(openid);
    }

    @Override
    public int addUser(User user) {
        return mapper.addUser(user);
    }

    @Override
    public int updatePreference(String openid, int preference) {
        return mapper.updatePreference(openid,preference);
    }

    @Override
    public String getSessionKey(String openid) {
        return mapper.getSessionKey(openid);
    }

    @Override
    public int updateSessionKey(String openid, String session_key) {
        return mapper.updateSessionKey(openid,session_key);
    }

    @Override
    public List<Fund> getFavouriteFund(String openid) {
        return mapper.getFavouriteFund(openid);
    }

    @Override
    public int addFavouriteFund(String openid, String code) {
        return mapper.addFavouriteFund(openid,code);
    }

    @Override
    public int deleteFavouriteFund(String openid, String code) {
        return mapper.deleteFavouriteFund(openid,code);
    }


}
